<style>
    #dict-add {
        padding: 20px 25px 25px 0;
    }
    #dict-add .layui-treeSelect .ztree li a, .ztree li span {
        margin: 0 0 2px 3px !important;
    }
</style>
<div class="layui-fluid" id="dict-add">
    <form class="layui-form" action="" lay-filter="dict-add-form">
        <div class="layui-form-item">
            <label class="layui-form-label zzdz-form-item-require">字典类型：</label>
            <div class="layui-input-block">
                <input type="text" name="type" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label zzdz-form-item">描述：</label>
            <div class="layui-input-block">
                <input type="text" name="description" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label zzdz-form-item">备注：</label>
            <div class="layui-input-block">
                <input type="text" name="remarks" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item zzdz-hide">
            <button class="layui-btn" lay-submit="" lay-filter="dict-add-form-submit" id="submit"></button>
            <button type="reset" class="layui-btn" id="reset"></button>
        </div>
    </form>
</div>

<script>
    layui.use(['zzdz', 'form', 'validate'], function () {
        var $ = layui.$,
            zzdz = layui.zzdz,
            layer = layui.layer,
            form = layui.form,
            validate = layui.validate;

        form.verify(validate);
        form.render();
        form.on('submit(dict-add-form-submit)', function (data) {
            zzdz.post(ctx + 'dict', data.field, function () {
                layer.closeAll();
                zzdz.alert.success('新增字典表成功');
                $('#zzdz-dict').find('#query').click();
            });
            return false;
        });
    });
</script>